Skip to content

Lazy submodule loading: import myotorch in 41 ms (was 2.2 s) - #3

Open
RaulSimpetru wants to merge 1 commit into
mainfrom
feat/lazy-loading
Open

Lazy submodule loading: import myotorch in 41 ms (was 2.2 s)#3
RaulSimpetru wants to merge 1 commit into
mainfrom
feat/lazy-loading

Conversation

@RaulSimpetru

Copy link
Copy Markdown
Member

Re-implements the lazy-loading idea from the pre-restructure local work on the current tree (the original commit targeted models/definitions/... paths that no longer exist). PEP 562 __getattr__ at the top level and in models; the zarr codec init is preserved by running it before any lazy resolution. from myotorch.models import RaulNetV19 etc. all keep working.

Suite: 25/25 collectable tests pass (same 9 pre-broken modules).

… 2.2 s

Re-implements the intent of the pre-restructure lazy-loading work
(backup/pre-rename-main, 2d0600b) on the current package layout: top-level
submodules and the emg_tensor/named_tensor re-exports resolve on first
access, model version classes resolve per class, and the zarr codec-pipeline
init is guaranteed to run before any lazy submodule loads.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant